#ifndef __DISPLAYDRIVER_H
#define __DISPLAYDRIVER_H

#ifdef __cplusplus
 extern "C" {
#endif
   
#include <stdint.h>
#include "System.h"

#if ENABLE_LCD
	 
#include "Panel.h"


typedef enum {
	LCD_STATUS_IDLE = 0,
	LCD_STATUS_INIT,
	LCD_STATUS_TRANSMITTING,
}LcdSta_E;

//BL  
#if(LCD_BACKLIGHT_TYPE == LCD_PWM_DIMMING)
    #define LCD_ON()	          g_lcdDriver.setBacklight(100)
    #define LCD_OFF()	          g_lcdDriver.setBacklight(0)
#else
    #define LCD_ON()	          (Lcd_BL_Port->BSRR = Lcd_BL_Pin)
    #define LCD_OFF()	          (Lcd_BL_Port->BRR = Lcd_BL_Pin)
#endif

typedef struct{
	LcdInfo_T	*info;
	LcdTiming_T	*timing;
	void 		(*init)(void);
	UINT8		(*isTransmitting)(void);
	void 		(*getFrameBuffer)(void **);
	void 		(*on)(void);
	void 		(*off)(void);
	void 		(*setBacklight)(UINT8);
	void 		(*drawPoint)(UINT16,UINT16,UINT32);
	void 		(*readPoint)(UINT16,UINT16,UINT16 *);
	void 		(*fillColor)(UINT16,UINT16,UINT16,UINT16,UINT32);
	void 		(*drawBitmap)(UINT16,UINT16,UINT16,UINT16,UINT8 *);
	void		(*transCompleteCall)(void);
}LcdDriver_T;

extern 	LcdDriver_T 		g_lcdDriver;


#endif
#ifdef __cplusplus
}
#endif
#endif
